let array = [1, 2, 3, 4, 5, 6];

console.log(array.slice(0, 3));
console.log(array.slice(0, 3));
console.log(array.slice(0, 3));
console.log("======================");
console.log(array.splice(0, 3));
console.log(array.splice(0, 3));
console.log(array.splice(0, 3));
console.log("======================");
// 纯函数
function getSum (n1, n2) {
  return n1 + n2;
}

console.log(getSum(1, 1));
console.log(getSum(1, 1));
console.log(getSum(1, 1));